package two_xia.ex9.Demo10;

class CurrentAccount extends Account {

    protected User queryUser() {
        // 模拟查询用户信息
        return new User("活期用户", "123456", "Current");
    }

    protected boolean isCurrentAccount(User user) {
        return "Current".equals(user.getAccountType());
    }

    protected boolean isSavingAccount(User user) {
        return "Saving".equals(user.getAccountType());
    }

    protected double calculateCurrentInterest(User user) {
        // 模拟活期利息计算
        return 10; // 假设利息为100元
    }

    protected double calculateSavingInterest(User user) {
        // 模拟定期利息计算
        return 0.0; // 活期账户不计算定期利息
    }

    protected void displayInterest() {
        System.out.println("显示活期账户利息。");
    }
}
